Added XEUS_SEARCH_PATH support in xeus-cpp#257
Added XEUS_SEARCH_PATH support in xeus-cpp#257kr-2003 wants to merge 3 commits intocompiler-research:mainfrom
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #257 +/- ##
==========================================
- Coverage 80.72% 80.22% -0.50%
==========================================
Files 19 19
Lines 970 981 +11
Branches 93 96 +3
==========================================
+ Hits 783 787 +4
- Misses 187 194 +7
|
|
|
||
| #include <memory> | ||
| #include <sstream> | ||
| #include <streambuf> |
There was a problem hiding this comment.
warning: included header sstream is not used directly [misc-include-cleaner]
| #include <streambuf> | |
| #include <streambuf> |
| publish_stream("stderr", s); | ||
| } | ||
|
|
||
| void interpreter::init_includes() |
There was a problem hiding this comment.
warning: method 'init_includes' can be made static [readability-convert-member-functions-to-static]
include/xeus-cpp/xinterpreter.hpp:74:
- void init_includes();
+ static void init_includes();
src/xinterpreter.cpp
Outdated
|
|
||
| void interpreter::init_includes() | ||
| { | ||
| Cpp::AddIncludePath((xeus::prefix_path() + "/include/").c_str()); |
There was a problem hiding this comment.
warning: no header providing "Cpp::AddIncludePath" is directly included [misc-include-cleaner]
Cpp::AddIncludePath((xeus::prefix_path() + "/include/").c_str());
^
src/xinterpreter.cpp
Outdated
| void interpreter::init_includes() | ||
| { | ||
| Cpp::AddIncludePath((xeus::prefix_path() + "/include/").c_str()); | ||
| if (const char* paths = std::getenv("XEUS_SEARCH_PATH")) { |
There was a problem hiding this comment.
warning: no header providing "std::getenv" is directly included [misc-include-cleaner]
src/xinterpreter.cpp:19:
- #ifndef EMSCRIPTEN
+ #include <cstdlib>
+ #ifndef EMSCRIPTEN| { | ||
| Cpp::AddIncludePath((xeus::prefix_path() + "/include/").c_str()); | ||
| if (const char* paths = std::getenv("XEUS_SEARCH_PATH")) { | ||
| std::istringstream stream(paths); |
There was a problem hiding this comment.
warning: no header providing "std::istringstream" is directly included [misc-include-cleaner]
src/xinterpreter.cpp:19:
- #ifndef EMSCRIPTEN
+ #include <sstream>
+ #ifndef EMSCRIPTEN| std::string path; | ||
| char delimiter = (std::string(paths).find(';') != std::string::npos) ? ';' : ':'; | ||
|
|
||
| while (std::getline(stream, path, delimiter)) |
There was a problem hiding this comment.
warning: no header providing "std::getline" is directly included [misc-include-cleaner]
while (std::getline(stream, path, delimiter))
^
Description
Added
interpreter::init_includesfunction and addedXEUS_SEARCH_PATHin CMakeLists.txt.Key Changes
interpreter::init_includes.CMakeLists.txtand/test/CMakeLists.txtfor joining include directories and testing respectively.Fixes #175
Type of change